import request from '@/utils/request'

// 添加商品信息
export function addGoods(data) {
  return request({
    url: '/goods/addOrEdit',
    method: 'post',
    data
  })
}

// 点击编辑，获取当前需要编辑的详细的商品信息
export function getGoodsInfo (params) {
  return request({
    url: '/goods/details',
    method: 'get',
    params
  })
}

export function getBanner (params) {
  return request({
    url: '/banner/list',
    method: 'get',
    params
  })
}

export function addBanner (data) {
  return request({
    url: '/banner/add',
    method: 'post',
    data
  })
}

export function removeBanner (params) {
  return request({
    url: '/banner/del',
    method: 'get',
    params
  })
}

export function changeStatus (params) {
  return request({
    url: '/banner/status',
    method: 'get',
    params
  })
}

export default {
  addGoods,
  getGoodsInfo,
  getBanner,
  addBanner,
  removeBanner,
  changeStatus
}